package org.hibernate.tool.ant;

import org.hibernate.tool.hbm2x.Exporter;

import com.xcesys.extras.tool.exporter.ExtrasDaoExpporter;

public class ExtrasDaoExporterTask extends BaseExtrasExporterTask {

	protected boolean impl = false;

	public void setImpl(boolean impl) {
		this.impl = impl;
	}

	public ExtrasDaoExporterTask(HibernateToolTask parent, boolean impl) {
		super(parent);
		this.impl = impl;
	}

	protected Exporter configureExporter(Exporter exp) {
		ExtrasDaoExpporter exporter = (ExtrasDaoExpporter) exp;
		super.configureExporter(exp);
		exporter.getProperties().setProperty("packageName", getPackageName());
		return exporter;
	}

	protected Exporter createExporter() {
		ExtrasDaoExpporter exporter = new ExtrasDaoExpporter(impl);
		return exporter;
	}

	public String getName() {
		return "Extras dao " + (impl ? "implementation" : "")
				+ "(Generates a set of .java files)";
	}

}
